#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<string.h>


#include"mystdio.h"
#define filename "./log.txt"

int main()
{
    myFILE* fp = my_open(filename,"w");
    int cnt = 5;
    char buff[64];
    while(cnt)
    {
        snprintf(buff,sizeof(buff),"hello bit hello linux %d\n",cnt--);
        my_fwrite(fp,buff,strlen(buff));
        sleep(2);
        DebugPrint(fp);
    }

    //fork();
    my_close(fp);
    return 0;
}


//int main()
//{
//    const char* s1 = "hello write\n";
//    write(1,s1,strlen(s1));
//
//    const char* s2 = "hello fwrite\n";
//    fwrite(s2,strlen(s2),1,stdout);
//
//    const char* s3 = "hello fprintf\n";
//    fprintf(stdout,"%s",s3);
//
//    fork();
//    return 0;
//}
